package z_stuff;

import java.io.File;
import java.io.IOException;

import tools.FileTools;
import tools.SparqlTools;

import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetFormatter;

public class TestTHO {
	
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		File f = new File("C:/Users/Jan/Desktop/Studium/KDDM/kddm-seminar/code/SemanticSearch/src/sparql/sparql1.txt");
//		String anfrage = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?article WHERE {GRAPH <http://dbpedia.org> {?entity rdf:type <http://dbpedia.org/ontology/MeanOfTransportation>} GRAPH <http://aifb.kit.edu/semanticsearch/textcorpus> {?article <http://aifb.kit.edu/semanticsearch/properties/hasAnnotation> ?entity.}}";
		String anfrage = FileTools.readFile(f);
		
		ResultSet rs = SparqlTools.sparqlQuery(anfrage, null);
		if ( rs.hasNext() ) ResultSetFormatter.out(System.out, rs);

	}
}
